#pragma once

#define INSTANCE_EXIST_ASSERTION assert(_instance != nullptr)

#define CREATE_SINGLETON(new_statement) \
	assert(_instance == nullptr); \
	if(_instance == nullptr) \
	{ \
		new_statement; \
	}

#define DELETE_SINGLETON \
	assert(_instance != nullptr); \
	SafeDelete(_instance);

#define SafeDelete(p) if(p != nullptr){delete p; p = nullptr; }
#define SafeDeleteArray(p) if(p != nullptr){delete[] p; p = nullptr; }
#define SafeRelease(p) if(p != nullptr){p->Release(); p = nullptr; }
